const cacheModule = {};
function require(dpArr,callBack){
    let params=[],count;
    if(dpArr.length>0){
        for (let i = 0; i <dpArr.length ; i++) {
            count++;
            loadModule(dpArr[i],function (param) {
                params[i] = param;
                count--;
                if(count == 0){
                    saveModule();
                }
            });
        }
    }else{
        saveModule();
    }
}
function getUrl(cc){
    return cc+".js";
}
function loadModule(modName,callBack){
    let url = getUrl(modName);
    if(cacheModule[modName]){
        cacheModule[modName].stata = "loaded";

    }else{
        let moduleObj = {
            modName,
            exportObj:null,
            stata:"loading",
            load:callBack
        }
        cacheModule.modName = moduleObj;
        let _script = document.createElement("script");
        _script.id = modName;
        _script.src = url;
        _script.async = true;
        _script.type="text/javascript";
        let fs = document.getElementsByName("script");
        fs.parentNode.insertBefore(_script,fs);
    }
}